package app.netant.book.txt44;

import cn.lily.com.enviroment.Enviroment;
import app.netant.book.base.BaseDetail;
import app.netant.book.base.BaseEntity;
import app.netant.book.base.BasePage;
import app.netant.book.base.BaseRoot;

public class Txt44Root extends BaseRoot {
	
	public Txt44Root(){
		this.homeUrl = "http://www.44txt.com/xuanhuanqihuan/index.html";
		this.pageUrl = "http://www.44txt.com/xuanhuanqihuan/index_";
		this.tableKey = "txt44";
	}

	@Override
	public String buildUrl(int pageIdx) {
		if(pageIdx==1){
			return homeUrl;
		}
		return this.pageUrl + pageIdx+".html";
	}

	@Override
	public BasePage buildPage(String url) {
		return new Txt44Page(url);
	}

	@Override
	public BaseDetail buildDetail(String url) {
		return new Txt44Detail(url);
	}

	@Override
	public BaseEntity buildEntity() {
		return new Txt44Entity();
	}
	
	@Override
	public void afterEntity(BaseEntity entity) {
		
	}
	
	public static void main(String[] args) {
		
		Enviroment.createEnv();
		Enviroment.getEnv().getLogBean().beginLog();
		
		Txt44Root root = new Txt44Root();
		//root.analyse(798);
		root.excepCycle();
	}


	
}
